package horse;

import java.util.ArrayList;

public class Ways
{
	private ArrayList<Area> area;
	private ArrayList<Integer> Steps;
	
	public Ways()
	{
		area = new ArrayList<Area>();
		Steps = new ArrayList<Integer>();
		
		
	}
	
	public void add( Area area, int Steps )
	{
		this.area.add(area);
		this.Steps.add(Steps);
	}
	
	public void clear()
	{
		area.clear();
		Steps.clear();
	}
	
	public int size()
	{
		return Steps.size();
	}
	
	public Area getArea(int id)
	{
		return area.get(id);
	}
	
	public int getSteps(int id)
	{
		return Steps.get(id);
	}
	
	public Ways FindShotWay()
	{
		Ways ShotWay = new Ways();
		
		int id=0;
		
		for (int i=1; i<Steps.size(); i++)
		{
			if ( Steps.get(id)>Steps.get(i) )
			{
				id = i;
			}
		}
		if (!area.isEmpty())
		{
			ShotWay.add(area.get(id), Steps.get(id));
		}
		return ShotWay;
	}
}
